from enum import Enum
from typing import List

from sqlalchemy import Column, PickleType
from sqlmodel import Field, SQLModel


class Gender(Enum):
    man = "1"
    woman = "2"


class Face(SQLModel, table=True):
    id: int | None = Field(primary_key=True, description="主键")
    name: str = Field(description="姓名")
    gender: Gender = Field(description="性别")
    mobile: str = Field(description="手机号")
    face_image: str = Field(description="人脸路径")
    face_area: dict[str, int | tuple[int, int]] = Field(sa_column=Column(PickleType), description="人脸位置")
    face_conf: float = Field(description="人脸置信度")
    face_vector: List[float] = Field(sa_column=Column(PickleType), description="人脸特征向量")
